<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

function listEstados()
{
	$estados = array(
					array('AC', 'Acre'),
					array('AL', 'Alagoas'),
					array('AP', 'Amap&aacute;'),
					array('AM', 'Amazonas'),
					array('BA', 'Bahia'),
					array('CE', 'Cear&aacute;'),
					array('DF', 'Distrito Federal'),
					array('GO', 'Goi&aacute;s'),
					array('ES', 'Esp&iacute;rito Santo'),
					array('MA', 'Maranh&atilde;o'),
					array('MT', 'Mato Grosso'),
					array('MS', 'Mato Grosso do Sul'),
					array('MG', 'Minas Gerais'),
					array('PA', 'Par&aacute;'),
					array('PB', 'Paraiba'),
					array('PR', 'Paran&aacute;'), 
					array('PE', 'Pernambuco'),
					array('PI', 'Piau&iacute;'),
					array('RJ', 'Rio de Janeiro'),
					array('RN', 'Rio Grande do Norte'),
					array('RS', 'Rio Grande do Sul'),
					array('RO', 'Rond&ocirc;nia'),
					array('RR', 'Ror&acirc;ima'),
					array('SP', 'S&atilde;o Paulo'),
					array('SC', 'Santa Catarina'),
					array('SE', 'Sergipe'),
					array('TO', 'Tocantins')
				);
	return $estados;
}

function listNiveis()
{
    $niveis = array(
                    array("A", "Administrador"),
                    array("G", "Gerente"),
                    array("S", "Supervisor"),
                    array("C", "Consultor"),
                    array("F", "Financeiro"),
                    array("R", "RH"),
                    array("T", "Telemarketing")
              );
    
    return $niveis;
}

function listTipoConta()
{
    $tipo = array(
                array("CL","Cliente Center Telecom"),
                array("CO","Concorrente"),
                array("PA","Parceiros"),
                array("RE","Representante"),
                array("CT","Cliente TIM")    
            );
        
    return $tipo;
}

function listStatusActivities()
{
    $status = array(
                    array("NI", "N&atilde;o Iniciado"),
                    array("EA", "Em Andamento"),
                    array("CO", "Completada"),
                    array("PE", "Pendente de Entrega"),
                    array("DI", "Diferido")
                );
                
    return $status;
}

function getStatusActivities($status)
{
    $respose = "";
    foreach (listStatusActivities() as $value) 
    {
        if ($value[0] == $status)
        {
            $respose = $value[1];
        }	
    }
    return $respose;
}

function listRelationship()
{
    $relationship = array(
                        array("OP", "Oportunidade"),
                        array("CO", "Conta"),
                        array("TA", "Tarefa")
                    );
    return $relationship;
}

function listPriority()
{
    $priority = array(
                    array("HI", "Alta"),
                    array("MI", "M&eacute;dia"),
                    array("LO", "Baixa")
                );
    return $priority;
}

function convertDateToMysql($date)
{
	$dt_mysql = explode("/", $date);
	return $dt_mysql[2]."-".$dt_mysql[1]."-".$dt_mysql[0];
}

function convertMysqlToDate($date)
{
	$dt_mysql = explode("-", $date);
	return $dt_mysql[2]."/".$dt_mysql[1]."/".$dt_mysql[0];
}
